<?php

/**
 * @author Terry & 千里孤坟
 * @copyright 2009
 */
class AtkSkill {
	
	public function __construct(){
		$this->id = -1;
		$this->on = 0;		//开关
		$this->name = "基类";
		$this->time = 0;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
        public function checkex($a) {
                if(isset($this->excid) && in_array($a->cid,$this->excid)) {
                        $this->name = "<font color=blue>EX".$this->name."</font>";
                        $this->ex = 1;
                        $this->exskset();
                }   
        }

        public function exskset() {
                return 1;
        }  

	public function action($a,$sk) {	
		return 0;
	}
	
	public function cancel($a) {
		$a->atkskill_status[$this->id]->on = 0;
		$a->atkskill_status[$this->id]->n = 0;
	}	
}

class BasuteBooster extends AtkSkill {
	
	public function __construct(){
		$this->id = 1;
		$this->on = 0;		//开关
		$this->name = "バステブースタ";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {		
		if(SkillHelper::ispureabnskill($sk) == 1) {
			$sk->ahits += 15;	
			$s = $a->name."バステブースタ加成，异常命中率上升。<br>";							
			$_SESSION['show'] .= $s;			
		}
		return 0;
	}

}

class AllCrtUp15 extends AtkSkill {

	public function __construct(){
		$this->id = 2;
		$this->on = 0;		//开关
		$this->name = "リベリオン";
		$this->time = 3;
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		if($sk->type == 0){
			$sk->crt += 15;		
			$s = "リベリオン效果发动！（第".$this->n."回合）。<br>";			
		}
		$_SESSION['show'] .= $s;
		
		return 0;
	}

}

class AllCrtUp30 extends AtkSkill {

	public function __construct(){
		$this->id = 3;
		$this->on = 0;		//开关
		$this->name = "レボリューション";
		$this->time = 3;
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		if($sk->type == 0){
			$sk->crt += 30;		
			$s = "レボリューション效果发动！（第".$this->n."回合）。<br>";			
		}
		$_SESSION['show'] .= $s;
		
		return 0;
	}
}

class PhyCharge extends AtkSkill {
	
	public function __construct(){
		$this->id = 4;
		$this->on = 0;		//开关
		$this->name = "蓄力";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->charge = 1.75;	
			$s = $a->name."蓄力中，物理伤害加倍。<br>";							
			$_SESSION['show'] .= $s;			
			$this->cancel($a);
			if($a->atkskill_status[9]->on == 1) $a->atkskill_status[9]->cancel($a);
		}

		return 0;
	}

}

class MgrCharge extends AtkSkill {
	
	public function __construct(){
		$this->id = 5;
		$this->on = 0;		//开关
		$this->name = "集中";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {

		if(SkillHelper::ismgcskill($sk) == 1) {
			$sk->charge = 1.75;	
			$s = $a->name."精神集中，魔法伤害加倍。<br>";							
			$_SESSION['show'] .= $s;			
			$this->cancel($a);
			if($a->atkskill_status[9]->on == 1) $a->atkskill_status[9]->cancel($a);
		}
		
		return 0;
	}

}

class Rousing extends AtkSkill {
	
	public function __construct(){
		$this->id = 6;
		$this->on = 0;		//开关
		$this->name = "觉醒中";
		$this->permanent = 1;
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		if($_SESSION['T'] != 11) {
			$sk->ap = round($sk->ap/2);
			$s = $a->name."觉醒中，一切AP消耗减半<br>";
			$_SESSION['show'] .= $s;
		}
		return 0;
	}

}

class Backfire extends AtkSkill {
	
	public function __construct(){
		$this->id = 7;
		$this->on = 0;		//开关
		$this->name = "反噬";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		if($sk->backfire == 1) {
			$s = $a->name."被自己的攻击反噬了。<br>";
			$_SESSION['show'] .= $s;
		}
		return 0;
	}

}

class Purka extends AtkSkill {
	
	public function __construct(){
		$this->id = 8;
		$this->on = 0;		//开关
		$this->name = "サルンガ";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {		
		//和ロンギヌス不能共存
		if($a->atkskill_status[25]->on == 1) return 0;
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->crt -= 1000;
			$sk->ap += 1;
			$_SESSION['result'] .= $a->name."的见切破坏武器效果发动(持久效果)。<br>";
		}
		return 0;
	}

	public function cancel($a) {
		return 0;
	}	

}

class Dcharge extends AtkSkill {
	
	public function __construct(){
		$this->id = 9;
		$this->on = 0;		//开关
		$this->name = "トリプルチャージ";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {
		if(SkillHelper::isphyskill($sk) == 1 || SkillHelper::ismgcskill($sk) == 1) {
			$sk->charge = 1.75;	
			$s = $a->name."双重蓄力中，伤害攻击威力加倍。<br>";
			$_SESSION['show'] .= $s;
			$this->cancel($a);
			if($a->atkskill_status[4]->on == 1) $a->atkskill_status[4]->cancel($a);
			if($a->atkskill_status[5]->on == 1) $a->atkskill_status[5]->cancel($a);
		}
		return 0;
	}

}

class MagicEnhanced extends AtkSkill {
	
	public function __construct(){
		$this->id = 11;
		$this->on = 0;		//开关
		$this->name = "魔法スキル強化";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		if(SkillHelper::ismgcskill($sk) == 1) {
			$sk->enhanced = 0.12;
			$_SESSION['result'] .= $this->name."加成<br>";
		}
		return 0;
	}

}

class Olding extends AtkSkill {
	
	public function __construct(){
		$this->id = 12;
		$this->on = 0;		//开关
		$this->name = "老化中";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		$sk->ap = floor($sk->ap * 1.5);
		$_SESSION['show'] .= $a->name."身体处于老化状态，行动点消耗1.5倍<br>";
		return 0;
	}

}

class EdenDrug extends AtkSkill {
	
	public function __construct(){
		$this->id = 13;
		$this->on = 0;		//开关
		$this->name = "天の配剤";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
		$this->excid = array(43,136);
		$this->v = 1.3;
	}

	public function exskset() {
		$this->v = 1.5;
	}	

	public function action($a,$sk) {
		if(!$this->ex) $this->checkex($a);
		if(SkillHelper::iscureskill($sk) == 1) {
			$sk->plus = $this->v;
			$_SESSION['result'] .= $a->name."的".$this->name."效果发动，恢复率增加。<br>";
		}
		return 0;
	}

}

class CrtPrediction extends AtkSkill {
	
	public function __construct(){
		$this->id = 14;
		$this->on = 0;		//开关
		$this->name = "会心の予言";
		$this->time = 3;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		if(SkillHelper::isdmgskill($sk) == 1) {
			$_SESSION['show'] .= $a->name."的".$this->name."效果发动。<br>";
			$sk->crt += $this->v;
		}
		return 0;
	}
}

class GodAttack extends AtkSkill {
	
	public function __construct(){
		$this->id = 15;
		$this->on = 0;		//开关
		$this->name = "万能アタック";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->all_atk = 1;
			$_SESSION['result'] .= $this->name."生效，".$sk->name."为万能物理<br>";
		}
	}
}

class Buste extends AtkSkill {
	
	public function __construct(){
		$this->id = 16;
		$this->on = 0;		//开关
		$this->name = "元素ブースタ";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		if(SkillHelper::iseleskill($sk) == 1 && $a->atkskill_status[44]->on != 1) {
			$sk->buste = 0.1;
			if($sk->puredead == 1) $sk->shits += 15;
			$_SESSION['result'] .= $this->name."加成<br>";
			$this->cancel($a);
		}
		return 0;
	}

}

class HiBuste extends AtkSkill {
	
	public function __construct(){
		$this->id = 17;
		$this->on = 0;		//开关
		$this->name = "元素ハイブースタ";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		if(SkillHelper::iseleskill($sk) == 1 && $a->atkskill_status[44]->on != 1) {
			$sk->hibuste = 0.2;
			$_SESSION['result'] .= $this->name."加成<br>";
			$this->cancel($a);
		}
		return 0;
	}

}

class Destroyer extends AtkSkill {
	
	public function __construct(){
		$this->id = 18;
		$this->on = 0;		//开关
		$this->name = "破壊神のゆえつ";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
		$this->v = 0.1;
		$this->excid = array(114);
	}

	public function exskset() {
		$this->v = 0.12;
	}
	
	public function action($a,$sk) {		
		if(!$this->ex) $this->checkex($a);
		if(SkillHelper::isdmgskill($sk) == 1) {
			$sk->destroyer = $this->v;
			$_SESSION['show'] .= $this->name."加成，".$a->name."的伤害提升<br>";
		}
		return 0;
	}

}

class SunCrt extends AtkSkill {
	
	public function __construct(){
		$this->id = 19;
		$this->on = 0;		//开关
		$this->name = "煌天の会心";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {		
		if(SkillHelper::isphyskill($sk) == 1 && $_SESSION['T'] == 6) {
			$sk->crt += 70;
			$_SESSION['result'] .= $this->name."加成，".$a->name."的会心率提升<br>";
		}
		return 0;
	}
}

class SilentCrt extends AtkSkill {
	
	public function __construct(){
		$this->id = 20;
		$this->on = 0;		//开关
		$this->name = "静天の会心";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {		
		if(SkillHelper::isphyskill($sk) == 1 && $_SESSION['T'] == 5) {
			$sk->crt += 70;
			$_SESSION['result'] .= $this->name."加成，".$a->name."的会心率提升<br>";
		}
		return 0;
	}
}

class ColorfulW extends AtkSkill {
	
	public function __construct(){
		$this->id = 21;
		$this->on = 0;		//开关
		$this->name = "極彩の疾風";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		if(SkillHelper::isdmgskill($sk) == 1) {
			$sk->hits += 30;
			$_SESSION['show'] .= $a->name."的".$this->name."效果发动，命中率增加。<br>";
		}
		return 0;
	}

}

class SkillMastery extends AtkSkill {
	
	public function __construct(){
		$this->id = 22;
		$this->on = 0;		//开关
		$this->name = "武道の心得";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
		$this->v = 0.6;
		$this->excid = array(29,50);
	}

	public function exskset() {
		$this->v = 0.5;
	}
	
	public function action($a,$sk) {
		$this->checkex($a);
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->sp = floor($sk->sp * $this->v);
			$_SESSION['result'] .= $a->name.$this->name."效果发动，".$sk->name."SP消耗降低<br>";
		}
	}
}

class MagicMastery extends AtkSkill {
	
	public function __construct(){
		$this->id = 23;
		$this->on = 0;		//开关
		$this->name = "魔術の素養";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
		$this->v = 0.6;
		$this->excid = array(38,100);
	}
	
	public function exskset() {
		$this->v = 0.5;
	}
	
	public function action($a,$sk) {		
		$this->checkex($a);
		if(SkillHelper::isphyskill($sk) == 0) {
			$sk->sp = floor($sk->sp * $this->v);
			$_SESSION['result'] .= $a->name.$this->name."效果发动，".$sk->name."SP消耗降低<br>";
		}
	}
}

class Weapon extends AtkSkill {
	
	public function __construct(){
		$this->id = 24;
		$this->on = 0;		//开关
		$this->name = "破耐性枪";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		//和ロンギヌス不能共存
		if($a->atkskill_status[25]->on == 1) return 0;
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->hits -= 5;
			$sk->crt -= 10;
			$sk->ap += 1;
			$_SESSION['result'] .= $a->name."的".$this->name."效果发动(持久效果)。<br>";
		}
	}
}

class Longki extends AtkSkill {
	
	public function __construct(){
		$this->id = 25;
		$this->on = 0;		//开关
		$this->name = "ロンギヌス";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		//和破耐性枪不能共存
		if($a->atkskill_status[24]->on == 1) return 0;
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->all_atk = 1;
			$sk->thru = 1;
			$sk->crt += 66;
			if(33 >= mt_rand(1,100)) {
				$_SESSION['result'] .= $this->name."攻击成功。<br>";
			} else {
				$sk->hp += 130;
				$sk->backfire = 1;
				$_SESSION['show'] .= $this->name."攻击反噬。<br>";
			}
		}
	}
}

class MirrorP extends AtkSkill {
	
	public function __construct(){
		$this->id = 26;
		$this->on = 0;		//开关
		$this->name = "ミラープリズン";
		$this->time = 0;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		if($sk->ap > 0) {
			$sk->ap += $this->v;
			$_SESSION['show'] .= $this->name."发动<br>";
		}
		return 0;
	}

}

class PhyBuste extends AtkSkill {
	
	public function __construct(){
		$this->id = 27;
		$this->on = 0;		//开关
		$this->name = "物理ブースタ";
		$this->time = 0;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {		
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->phybuste = 0.2;
			$_SESSION['result'] .= $this->name."加成<br>";
		}
		return 0;
	}

}

class PhyHiBuste extends AtkSkill {
	
	public function __construct(){
		$this->id = 28;
		$this->on = 0;		//开关
		$this->name = "物理ハイブースタ";
		$this->time = 0;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {		
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->phyhibuste = 0.3;
			$_SESSION['result'] .= $this->name."加成<br>";
		}
		return 0;
	}

}

class SDayAtkSkill extends AtkSkill {
	
	public function __construct(){
		$this->id = 29;
		$this->on = 1;		//开关 TODO
		$this->name = "攻击性特殊地形前置";
		$this->time = 0;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {
		if($_SESSION['T'] < 2) return 0;
		if($_SESSION['T'] == 5) { //格拉那达
			$sk->crt += 20;
			$_SESSION['result'] .= $a->name."会心率提升<br>";
		} elseif($_SESSION['T'] == 7) { //恒河
			if(SkillHelper::ispureabnskill($sk) == 1) {
				$_SESSION['result'] .= $sk->name."消耗降低<br>";
				$sk->ap = round($sk->ap*2/3);
				$sk->sp = round($sk->sp*2/3);
			}
		} elseif($_SESSION['T'] == 9) { //胡夫金字塔
			if(SkillHelper::iscureskill($sk) == 1) {
				$_SESSION['result'] .= $sk->name."消耗降低<br>";
				$sk->ap = round($sk->ap*2/3);
				$sk->sp = round($sk->sp*2/3);
			}
		} elseif($_SESSION['T'] == 2) { //克里特岛
			$sk->ahits -= 10;	
			$_SESSION['result'] .= $a->name."异常附着率下降<br>";
		} elseif($_SESSION['T'] == 10) { //巴比伦空中花园
			$sk->expwr *= 0.8;
			$sk->ahits += 20;
			$_SESSION['result'] .= $sk->name."威力下降，异常附着率上升<br>";
		} elseif($_SESSION['T'] == 12) { //巴别塔
			if(!$sk->isunique) {
				$_SESSION['result'] .= $sk->name."AP消耗减半<br>";
				$sk->ap = floor($sk->ap/2);
			}
		} elseif($_SESSION['T'] == 13) {	//迦南美地
			if($sk->isunique == 1) {
				$_SESSION['result'] .= $sk->name."AP消耗减半<br>";
				$sk->ap = floor($sk->ap/2);
			}
		}
		return 0;
	}

	public function cancel($a) {
		return 0;
	}	

}

class NoCost extends AtkSkill {
	
	public function __construct(){
		$this->id = 30;
		$this->on = 0;		//开关
		$this->name = "无损耗";
		$this->time = 0;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		$sk->sp = $sk->tp = 0;
		$_SESSION['result'] .= $a->name."本次行动无损耗<br>";
		$this->cancel($a);
		return 0;
	}

}

class ExFireResKill extends AtkSkill {
	
	public function __construct(){
		$this->id = 31;
		$this->on = 0;		//开关
		$this->name = "火炎ガードキルEX";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {
		if($sk->atk_type == 1 || $sk->exprop == 1) {
			$sk->all_atk = 1;
			$sk->thru = 1;
			$_SESSION['show'] .= $this->name."生效，".$sk->name."附加万能与贯通属性<br>";
		}
	}
}

class ExIceResKill extends AtkSkill {
	
	public function __construct(){
		$this->id = 32;
		$this->on = 0;		//开关
		$this->name = "氷結ガードキルEX";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {
		if($sk->atk_type == 2 || $sk->exprop == 2) {
			$sk->all_atk = 1;
			$sk->thru = 1;
			$_SESSION['show'] .= $this->name."生效，".$sk->name."附加万能与贯通属性<br>";
		}
	}
}

class ExWindResKill extends AtkSkill {
	
	public function __construct(){
		$this->id = 33;
		$this->on = 0;		//开关
		$this->name = "疾風ガードキルEX";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {
		if($sk->atk_type == 5 || $sk->exprop == 5) {
			$sk->all_atk = 1;
			$sk->thru = 1;
			$_SESSION['show'] .= $this->name."生效，".$sk->name."附加万能与贯通属性<br>";
		}
	}
}

class ExThunderResKill extends AtkSkill {
	
	public function __construct(){
		$this->id = 34;
		$this->on = 0;		//开关
		$this->name = "電撃ガードキルEX";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {
		if($sk->atk_type == 3 || $sk->exprop == 3) {
			$sk->all_atk = 1;
			$sk->thru = 1;
			$_SESSION['show'] .= $this->name."生效，".$sk->name."附加万能与贯通属性<br>";
		}
	}
}

class ExEarthResKill extends AtkSkill {
	
	public function __construct(){
		$this->id = 35;
		$this->on = 0;		//开关
		$this->name = "地变ガードキルEX";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {
		if($sk->atk_type == 4 || $sk->exprop == 4) {
			$sk->all_atk = 1;
			$sk->thru = 1;
			$_SESSION['show'] .= $this->name."生效，".$sk->name."附加万能与贯通属性<br>";
		}
	}
}

class BeCommanded extends AtkSkill {
	
	public function __construct(){
		$this->id = 36;
		$this->on = 0;		//开关
		$this->name = "被号令中";
		$this->time = 1;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {		
		$sk->ap = round($sk->ap/2);
		$_SESSION['show'] .= $a->name."本次行动AP消耗减半!<br>";
		$this->cancel($a);
		return 0;
	}

}

class OmniWeapon extends AtkSkill {
	
	public function __construct(){
		$this->id = 37;
		$this->on = 0;		//开关
		$this->name = "トリアイナ";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		if($a->atkskill_status[25]->on == 1) return 0;
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->all_atk = 1;
			$sk->hits -= 10;
			$sk->crt = -1000;
			$sk->sp += 20;
			$sk->ap += 2;
			$_SESSION['result'] .= $a->name."的".$this->name."效果发动，攻击附加万能属性。<br>";
		}
	}
}

class ThruWeapon extends AtkSkill {
	
	public function __construct(){
		$this->id = 38;
		$this->on = 0;		//开关
		$this->name = "トリシューラ";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		if($a->atkskill_status[25]->on == 1) return 0;
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->thru = 1;
			$sk->sp += 20;
			$sk->ap += 2;
			$tmp = mt_rand(1,100);
			$_SESSION['result'] .= $this->name."反噬乱数：$tmp<br>";
			if(13 >= $tmp) {
				$sk->backfire = 1;
				$_SESSION['show'] .= $this->name."攻击反噬。<br>";
			} else {
				$_SESSION['show'] .= $a->name."的".$this->name."效果成功发动，攻击附加贯通属性。<br>";
			}
		}
	}
}

class BreathWeapon extends AtkSkill {
	
	public function __construct(){
		$this->id = 39;
		$this->on = 0;		//开关
		$this->name = "ロンゴミアント";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		if($a->atkskill_status[25]->on == 1) return 0;
		if(SkillHelper::isphyskill($sk) == 1) {
			$a->eventskill_status[24]->on = 1;
			$sk->exprop = 4;
			$sk->sp += 20;
			$sk->ap += 1;
			$_SESSION['show'] .= $a->name."的".$this->name."效果发动中。<br>";
		}
	}
}

class FireWeapon extends AtkSkill {
	
	public function __construct(){
		$this->id = 40;
		$this->on = 0;		//开关
		$this->name = "ツタンカーメン";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		if($a->atkskill_status[25]->on == 1) return 0;
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->exprop = 1;
			$sk->sp += 10;
			$sk->ap += 1;
			$_SESSION['result'] .= $a->name."的".$this->name."效果发动，攻击附加火属性。<br>";
		}
	}
}

class IceWeapon extends AtkSkill {
	
	public function __construct(){
		$this->id = 41;
		$this->on = 0;		//开关
		$this->name = "カラドボルグ";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		if($a->atkskill_status[25]->on == 1) return 0;
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->exprop = 2;
			$sk->sp += 10;
			$sk->ap += 1;
			$_SESSION['result'] .= $a->name."的".$this->name."效果发动，攻击附加冰属性。<br>";
		}
	}
}

class EleWeapon extends AtkSkill {
	
	public function __construct(){
		$this->id = 42;
		$this->on = 0;		//开关
		$this->name = "アパラージタ";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		if($a->atkskill_status[25]->on == 1) return 0;
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->exprop = 1;
			$sk->sp += 10;
			$sk->ap += 2;
			$_SESSION['result'] .= $a->name."的".$this->name."效果发动，攻击附加元素属性。<br>";
		}
	}
}

class OracleStone extends AtkSkill {
	
	public function __construct(){
		$this->id = 43;
		$this->on = 0;		//开关
		$this->name = "叡者の石";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {		
		if($sk->puredead == 1 && $sk->atk_type < 8) {
			unset($sk->puredead);
			if($sk->dbase == 40) $sk->pwr = 270;
			elseif($sk->dbase == 50) $sk->pwr = 300;
			elseif($sk->dbase == 60) $sk->pwr = 340;
			$s = $a->name.$this->name."效果发动，即死被转化为属性攻击。<br>";
			$_SESSION['show'] .= $s;			
		}
		return 0;
	}

}

class EleAllAttack extends AtkSkill {
	
	public function __construct(){
		$this->id = 44;
		$this->on = 0;		//开关
		$this->name = "元素乱舞";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {
		if(SkillHelper::iseleskill($sk) == 1) {
			$sk->all_atk = 1;
			$_SESSION['result'] .= $this->name."生效，".$sk->name."为万能元素<br>";
			$this->cancel($a);
		}
	}
}

class LightWeapon extends AtkSkill {
	
	public function __construct(){
		$this->id = 45;
		$this->on = 0;		//开关
		$this->name = "ソロモンの王剣";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		if($a->atkskill_status[25]->on == 1) return 0;
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->exprop = 6;
			$sk->sp += 10;
			$sk->ap += 1;
			$sk->hits -= 10;
			$_SESSION['result'] .= $a->name."的".$this->name."效果发动，攻击附加光属性。<br>";
		}
	}
}

class DarkWeapon extends AtkSkill {
	
	public function __construct(){
		$this->id = 46;
		$this->on = 0;		//开关
		$this->name = "ティルヴィング";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		if($a->atkskill_status[25]->on == 1) return 0;
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->exprop = 7;
			$sk->sp += 10;
			$sk->ap += 1;
			$sk->hits -= 10;
			$_SESSION['result'] .= $a->name."的".$this->name."效果发动，攻击附加暗属性。<br>";
		}
	}
}

class ZionSpear extends AtkSkill {
	
	public function __construct(){
		$this->id = 47;
		$this->on = 0;		//开关
		$this->name = "天の矛";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->all_atk = 1;
			$sk->thru = 1;
			$sk->sp += 20;
			$_SESSION['result'] .= $a->name."的".$this->name."效果发动，攻击附加万能贯通属性。<br>";
		}
	}
}

class CriticalMaster extends AtkSkill {
	
	public function __construct(){
		$this->id = 48;
		$this->on = 0;		//开关
		$this->name = "会心激化";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		$_SESSION['result'] .= $a->name."的".$this->name."效果发动<br>";
		$sk->crtmaster = 1.8;
	}
}

class NornsReverse extends AtkSkill {
	
	public function __construct(){
		$this->id = 49;
		$this->on = 0;		//开关
		$this->name = "天命反转";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 0;	//持久效果
	}
	
	public function action($a,$sk) {
		if(SkillHelper::isaskill($sk) == 1 && $sk->ap > 0) {
			$_SESSION['result'] .= $a->name."的".$this->name."效果发动<br>";
			$sk->isunique = 1;
			$sk->ap = floor($sk->ap * 1.5);
			$this->cancel($a);
		}
	}
}

class CriticalBuff extends AtkSkill {
	
	public function __construct(){
		$this->id = 50;
		$this->on = 0;		//开关
		$this->name = "会心";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		if(SkillHelper::isdmgskill($sk) == 1) {
			$_SESSION['result'] .= $a->name."的".$this->name."效果发动<br>";
			if(!isset($sk->crtbuff)) $sk->crtbuff = 0;
			$sk->crtbuff += 15;
		}
	}
}

class OpenEyed extends AtkSkill {
	
	public function __construct(){
		$this->id = 51;
		$this->on = 0;		//开关
		$this->name = "黒い神の開目";
		$this->time = 3;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {
		if(SkillHelper::isdmgskill($sk) == 1) {
			$_SESSION['result'] .= $a->name."的".$this->name."效果发动，会心率增加<br>";
			if(!isset($sk->crtbuff)) $sk->crtbuff = 0;
			$sk->crtbuff += 30;
		}
	}
}

class HellS extends AtkSkill {
	
	public function __construct(){
		$this->id = 52;
		$this->on = 0;		//开关
		$this->name = "異界の住人";
		$this->time = 2;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
	}
	
	public function action($a,$sk) {
		$sk->ap = floor($sk->ap/2);
	}
}

class HamaBuste extends AtkSkill {
	
	public function __construct(){
		$this->id = 53;
		$this->on = 0;		//开关
		$this->name = "ハマブースタ";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;
	}
	
	public function action($a,$sk) {		
		if(SkillHelper::iseleskill($sk) == 1 && $sk->atk_type == 6) {
			$sk->buste = 0.1;
			if($sk->puredead == 1) $sk->shits += 15;
			$_SESSION['result'] .= $this->name."加成<br>";
			$this->cancel($a);
		}
		return 0;
	}

}

class MutoBuste extends AtkSkill {
	
	public function __construct(){
		$this->id = 54;
		$this->on = 0;		//开关
		$this->name = "ムドブースタ";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;
	}
	
	public function action($a,$sk) {		
		if(SkillHelper::iseleskill($sk) == 1 && $sk->atk_type == 7) {
			$sk->buste = 0.1;
			if($sk->puredead == 1) $sk->shits += 15;
			$_SESSION['result'] .= $this->name."加成<br>";
			$this->cancel($a);
		}
		return 0;
	}
}

class NorEleWeapon extends AtkSkill {
	
	public function __construct(){
		$this->id = 55;
		$this->on = 0;		//开关
		$this->name = "单元素武器";
		$this->time = 99;	//持续回合数，99即作为永久
		$this->n = 0;		//当前进行次数
		$this->permanent = 1;	//持久效果
	}
	
	public function action($a,$sk) {
		if($a->atkskill_status[25]->on == 1) return 0;
		if(SkillHelper::isphyskill($sk) == 1) {
			$sk->exprop = 1;
			$sk->sp += 10;
			$sk->ap += 1;
			$_SESSION['result'] .= $a->name."的".$this->name."效果发动，攻击附加常规元素属性。<br>";
		}
	}
}

?>
